#include "Matrix.h"

Matrix::Matrix() {
	values[0] = 1;
	values[1] = 0;
	values[2] = 0;
	values[3] = 0;
	values[4] = 0;
	values[5] = 1;
	values[6] = 0;
	values[7] = 0;
	values[8] = 0;
	values[9] = 0;
	values[10] = 1;
	values[11] = 0;
	values[12] = 0;
	values[13] = 0;
	values[14] = 0;
	values[15] = 1;
}

Matrix::~Matrix() {

}

Point3D Matrix::getForward() {
	return Point3D(values[0], values[1], values[2]);
}

Point3D Matrix::getLeft() {
	return Point3D(values[4], values[5], values[6]);
}

Point3D Matrix::getUp() {
	return Point3D(values[8], values[9], values[10]);
}

void Matrix::setTo(Point3D forward, Point3D left, Point3D up) {
	values[0] = forward.x;
	values[1] = forward.y;
	values[2] = forward.z;

	values[4] = left.x;
	values[5] = left.y;
	values[6] = left.z;

	values[8] = up.x;
	values[9] = up.y;
	values[10] = up.z;
}

double & Matrix::operator[](int index) {
	return values[index];
}
